package com.dongdongshop.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
/**
 * 商品表，SPU表
 * @TableName tb_item
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "goods", shards = 1, replicas = 1)
public class TbGoodsES implements Serializable {
    @Id
    private Long id;
    /**
     * 商家ID
     */
    @Field(name = "seller_id",type = FieldType.Text)
    private String sellerId;
    /**
     * SPU名
     */
    @Field(name = "goods_name",type = FieldType.Text, analyzer = "ik_max_word")
    private String goodsName;
    /**
     *默认SKU
     */
    @Field(name = "default_item_id",type = FieldType.Long)
    private Long defaultItemId;
    /**
     * 状态0未审核1审核通过2审核未通过
     */
    @Field(name = "audit_status",type = FieldType.Text)
    private String auditStatus;
    /**
     * 是否上架
     */
    @Field(name = "is_marketable",type = FieldType.Text)
    private String isMarketable;
    /**
     * 品牌
     */
    @Field(name = "brand_id",type = FieldType.Long)
    private Long brandId;
    /**
     * 副标题
     */
    @Field(name = "caption",type = FieldType.Text)
    private String caption;
    /**
     * 一级类目
     */
    @Field(name = "category1_id",type = FieldType.Long)
    private Long category1Id;
    /**
     * 二级类目
     */
    @Field(name = "category2_id",type = FieldType.Long)
    private Long category2Id;
    /**
     * 三级类目
     */
    @Field(name = "category3_id",type = FieldType.Long)
    private Long category3Id;
    /**
     * 小图
     */
    @Field(name = "small_pic",type = FieldType.Text)
    private String smallPic;
    /**
     * 商品价格，单位为：元
     */
    @Field(type = FieldType.Float)
    private BigDecimal price;
    /**
     * 分类模板ID
     */
    @Field(name = "type_template_id",type = FieldType.Long)
    private Long typeTemplateId;
    /**
     * 是否启用规格
     */
    @Field(name = "is_enable_spec",type = FieldType.Text)
    private String isEnableSpec;
    /**
     * 是否删除
     */
    @Field(name = "is_delete",type = FieldType.Text)
    private String isDelete;
}